import Link from '~/components/text/link'
import { InlineCode, Code } from '~/components/text/code'
import Caption from '~/components/text/caption'
import Note from '~/components/text/note'

export const meta = {
  editUrl: 'pages/docs/api/v2/api-docs-mdx/api-basics/authentication.mdx',
  lastEdited: '2019-10-17T14:44:04.000Z'
}

## Authentication

Requests to the ZEIT Now API must provide an API token through the `Authorization` header:

<Code>
    Authorization: Bearer{' '}
    {props.testingToken ? props.testingToken.token : '<TOKEN>'}
</Code>
<Caption>
    The <InlineCode>Authorization</InlineCode> header with a token.
</Caption>

API queries for resources owned by a team require a `teamId` query string at the end of the API endpoint URL and use the team's ID as the value:

<Code>https://api.zeit.co/v6/now/deployments?teamId=[team ID]</Code>
<Caption>
    An API endpoint using a team ID with the <InlineCode>teamId</InlineCode>{' '}
    query string.
</Caption>

<Note>
  You can find your own team's ID using the{' '}
  <Link href="#endpoints/teams/list-all-your-teams">
    <InlineCode>teams</InlineCode> endpoint
  </Link>
  .
</Note>

### Failed Authentication

If authentication is unsuccessful for a request, the [error status code](#api-basics/errors) **403** is returned.
